package com.xc.tjise.TJISE.day10;

public class MT5 implements Runnable{
    public static void main(String[] args) {
        Thread thread1 =new Thread(new MT5());
        thread1.setName(" thread 1 ");
        Thread thread2 =new Thread(new MT5());
        thread2.setName(" thread 2 ");

        thread1.start();
        thread2.start();

        System.out.println(" test ");

    }
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println( i+" : " + Thread.currentThread().getName()+" is rinning =-=");
            if (i%10==0){
                System.out.println(" 让步 ");
                Thread.yield();
            }
        }
    }
}
